import { STColumn } from '@delon/abc/st';
import { environment } from '@env/environment';

export interface Tjpn4Config {
	url?: string;
	data?: any;
	columns: Columns[] | any[];
	autoLoad?: boolean;
	showPage?: boolean;
	height?: string;
	params?: any;
}

export interface Columns extends STColumn {
	allowHid: boolean;
	checked: boolean;
}

export const Tjpn4STConfig: any = {
	widthMode: {
		type: 'strict',
	},
	req: {
		ignoreParamNull: true,
		lazyLoad: true,
		reName: {
			pi: 'current',
			ps: 'size',
		},
	},
	multiSort: {
		key: 'orders',
		separator: ',',
		nameSeparator: ':',
		keepEmptyKey: false,
	},
	res: {
		process: (data, rawData) => {
			return rawData.records || rawData;
		},
	},
	page: {
		pageSizes: environment.nzPageSizeOptions,
		showSize: true,
		toTop: false,
		show: true,
	},
	pi: 1,
	ps: 20,
	rowClassName: (d, i) => {
		return i % 2 === 0 ? 'odd_event_row_color' : '';
	},
};
